import React, { Component } from 'react';

class Tesing extends Component {
    state={
        msg:""
    }
    handClick=(e)=>{
        this.setState({
            msg:e
        })
    }
    render() {
        return (
            <div>
                <Borther handlePass={this.handClick}></Borther>
                <Bortherboth msg={this.state.msg}></Bortherboth>
            </div>
        );
    }
}
class Borther extends Component{
    state={
        msg:"你兄弟的值☞"
    }
    render(){
        return (
            <div>
                <button onClick={()=>{this.props.handlePass(this.state.msg)}}>点击传值</button>
            </div>
        )
    }
}
class Bortherboth extends Component{
    render(){
        return (
            <div>
                兄弟传过来的值:{this.props.msg}
            </div>
        )
    }
}
export default Tesing;